
package com.seekting.gongzhu.serversdk;

import com.google.gson.Gson;
import com.seekting.gongzhu.sdk.Info;
import com.seekting.gongzhu.sdk.gson.ActionJson;
import com.seekting.gongzhu.sdk.gson.PrepareJson;

public class ServerParser {

    public static void parse(String str, IServer iserver) {
        Gson gson = new Gson();
        ActionJson actionJson = gson.fromJson(str, ActionJson.class);
        switch (actionJson.getAction()) {
            case Info.Action.PREPARE:
                PrepareJson prepareJson = gson.fromJson(str, PrepareJson.class);
                iserver.onPrepared(prepareJson.getIndex());
                break;

            default:
                break;
        }
    }
}
